package io.renren.modules.generator.dao;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import io.renren.common.vo.ProductAddressVo;
import io.renren.modules.generator.entity.AddressEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 
 * 
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2018-11-27 14:55:22
 */
@Mapper
public interface AddressDao extends BaseMapper<AddressEntity> {

    List<AddressEntity> queryPage(Map<String, Object> params);

    int queryPageTotal(Map<String, Object> params);

    void updateStatusByIds(List<Integer> list);

    List<AddressEntity> queryAddressesByCustomerId(@Param("id") int id);


    List<AddressEntity> queryAddressByCustomerIdAndByAddressProperty(@Param("customerId") int customerId, @Param("addressProperty") String addressProperty);

    AddressEntity queryById(Integer id);

    List<AddressEntity> queryAddressByProperty(@Param("property") String property);

    Set<AddressEntity> queryFromAddressEntityListByToAddressIdAndProductId(@Param("toAddressId") Integer toAddressId, @Param("productId") Integer productId);

    List<AddressEntity> queryEntityListByCode(@Param("code") String code, @Param("type") String type, @Param("customerId") Integer customerId);

    List<AddressEntity> queryToExcelExport(Map<String, Object> params);

    int queryTotalToExcelExport(Map<String, Object> params);

    List<ProductAddressVo> queryToAddressByToAddressNameAndProductId(@Param("addressName") String addressName, @Param("productId") Integer productId);
}
